package com.eattravel.service.impl;

import com.eattravel.mapper.CommodityMapper;
import com.eattravel.pojo.Commodity;
import com.eattravel.service.HomeHotFoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author glong
 * @date 2019/9/19 11:09
 * 描述：主页热门食物service
 */

@Service
public class HomeHotFoodServiceImpl implements HomeHotFoodService {
    @Autowired
    private CommodityMapper commodityMapper;

    @Override
    public List<Commodity> getHomeHotFoodList() {
        List<Commodity> commodities = commodityMapper.selectForHome();
        if (commodities.size() != 0) {
            return commodities;
        }
        return null;
    }
}
